package com.huluobo.a2201mvvm_imdemo.chat;

import android.content.Intent;
import android.view.View;

import com.blankj.utilcode.util.ToastUtils;
import com.huluobo.a2201mvvm_imdemo.R;
import com.huluobo.a2201mvvm_imdemo.pay.PayActivity;
import com.hyphenate.easeui.modules.chat.EaseChatFragment;
import com.hyphenate.easeui.modules.chat.interfaces.IChatExtendMenu;

/**
 * Created by LC on 2024/4/7.
 */
public class ChatFragment extends EaseChatFragment {

    @Override
    public void initView() {
        super.initView();
//        IChatExtendMenu chatExtendMenu = chatInputMenu.getChatExtendMenu();
        IChatExtendMenu chatExtendMenu = chatLayout.getChatInputMenu().getChatExtendMenu();
        chatExtendMenu.registerMenuItem("红包", R.drawable.baseline_payment_24, 333);
    }

    @Override
    public void onChatExtendMenuItemClick(View view, int itemId) {
        if (itemId == 333) {
            Intent intent = new Intent(requireContext(), PayActivity.class);
            intent.putExtra("conversationId", conversationId);
            startActivity(intent);
        } else if (itemId == com.hyphenate.easeui.R.id.extend_item_location) {
            ToastUtils.showLong("点击了位置");
            return;
        }
        super.onChatExtendMenuItemClick(view, itemId);

    }
}
